/*** Eclipse Class Decompiler plugin, copyright (c) 2012 Chao Chen (cnfree2000@hotmail.com) ***/
package com.qihoo.gamecenter.sdk.login.plugin.g;

import android.content.Context;
import android.content.Intent;
import com.qihoo.gamecenter.sdk.login.plugin.a.h;
import com.qihoo.gamecenter.sdk.login.plugin.h.d;
import com.qihoo.gamecenter.sdk.login.plugin.h.e;
import com.qihoo.gamecenter.sdk.login.plugin.h.f;
import com.qihoo.gamecenter.sdk.login.plugin.login.c;
import org.json.JSONObject;

public class g extends a {
    private boolean d = false;

    public g(Context paramContext, Intent paramIntent, c paramc, String paramString) {
        super(paramContext, paramIntent);
        if (paramString != null)
            e.a("LoginByQTTask", new Object[] { "cookie is: ", paramString });
        d.a(paramString);
    }

    protected String a(String[] paramArrayOfString) {
        String str1 = h.a(this.b, com.qihoo.gamecenter.sdk.login.plugin.h.a.a(this.c));
        e.a("LoginByQTTask", new Object[] { "url: " + str1 });
        String str2 = com.qihoo.gamecenter.sdk.login.plugin.d.a.a(this.b, str1, 1);
        e.a("LoginByQTTask", new Object[] { "svr ret :" + str2 });
        e.a("LoginByQTTask", new Object[] { "server ret qt = ", d.b() });
        return b(str2);
    }

    protected void a(String paramString) {
        super.a(paramString);
        if (false != this.d)
            return;
        d.c();
        f.i(this.b);
    }

    protected String b(String paramString) {
        int i = 0;
        String str = paramString;
        try {
            JSONObject localJSONObject1 = new JSONObject(str);
            JSONObject localJSONObject2 = localJSONObject1.getJSONObject("content");
            int j = localJSONObject2.optInt("errno", -1);
            if (0 == j) {
                this.d = true;
                JSONObject localJSONObject3 = localJSONObject2.getJSONObject("data");
                localJSONObject2.remove("data");
                localJSONObject2.put("user", localJSONObject3);
                str = localJSONObject1.toString();
                i = 1;
            }
        } catch (Exception localException) {
            e.b("LoginByQTTask", "convert ret err!", localException);
        }
        e.a("LoginByQTTask", new Object[] { "convert ret: " + str });
        return str;
    }
}